package org.yaosheng.blog.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.yaosheng.blog.dao.UserRepository;
import org.yaosheng.blog.po.User;
import org.yaosheng.blog.service.UserService;
import org.yaosheng.blog.util.MD5Utils;

/**
 * Created by yaosheng on 2019/12/9.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password){
        return userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
    }
}